// HarrFeatures.h: interface for the CHarrFeatures class.
//
//////////////////////////////////////////////////////////////////////

#ifndef HARR_FEATURES_H
#define HARR_FEATURES_H

#include "ASample.h"

class CHarrFeature
{
public:
	CHarrFeature(){}
	CHarrFeature(int t1, int w1, int h1, int x1, int y1)
	{
		type = t1, w = w1, h = h1, x = x1, y = y1;
	}
	CHarrFeature operator=(const CHarrFeature& harr)
	{
		type = harr.type;
		w = harr.w;
		h = harr.h;
		x = harr.x;
		y = harr.y;
		return *this;
	}
	int type, w, h, x, y;
};


class CHarrFunction
{
public:
	CHarrFunction(){}
	CHarrFunction(double t, int flg)
	{
		th = t; flag = flg;
	}
	CHarrFunction operator=(const CHarrFunction& harrf)
	{
		th = harrf.th;
		flag = harrf.flag;
		return *this;
	}
	int Classify(double val)
	{
		return (((val - th) > 0)? 1 : -1) * flag > 0;
	}
	double th, er; // threshold and error rate
	int	flag;
};


class CHarrFeatures  
{
public:
	CHarrFeatures();
	virtual ~CHarrFeatures();

	void Generate(int imgw, int imgh);

	std::vector<CHarrFeature> m_vHarr;
};

#endif // !defined(AFX_HARRFEATURES_H__EFEF04C6_F065_4B2F_8964_1DE31E1E2D95__INCLUDED_)
